Skip to content

Conversation

@june-hua
Copy link
Contributor

No description provided.

@june-hua june-hua self-assigned this Nov 17, 2025


case "${SERVER}" in
"dev-stable") echo "https://workbench-dev.verily.com/api/${SERVER}" ;;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be

Suggested change
"dev-stable") echo "https://workbench-dev.verily.com/api/${SERVER}" ;;
"dev-stable") echo "https://workbench-dev.verily.com/api/${1}" ;;


MONITORING_UTILS_FILE="/home/core/monitoring-utils.sh"
FIRST_BOOT_START_FILE="/home/core/first-boot-start"
if [[ -f "${MONITORING_UTILS_FILE}" && ! -f "${FIRST_BOOT_START_FILE}" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, do we expect cases where the monitoring-utils file doesn't exist?

function get_service_url() {
SERVER="$(get_metadata_value "terra-cli-server" "")"
if [[ -z "${SERVER}" ]]; then
SERVER="dev-stable"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be prod?


source /home/core/service-utils.sh

WORKSPACE_ID="$(get_metadata_value "terra-workspace-id" "")"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source metadata-util

&& docker ps -q --filter "name=application-server" | grep -q .; then
echo "Proxy is ready."
status="$(get_guest_attribute "startup_script/status" "")"
success=0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: status_code since it's not just success

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so 0 is success and 1 is failure?

i'm little confused because devcontainer start is passing in success:1

payload=$(cat <<EOF
{
"state": "DEVCONTAINER_END",
"success": ${SUCCESS}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it too late to change this to status too?

echo "VM state recorded successfully: ${response_body}"
}

function record_devcontainer_start() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we refactor the two method to calls function log_event() and pass in payload?

payload=$(cat <<EOF
{
"state": "DEVCONTAINER_START",
"success": 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the openapi in your add endpoint PR this is a boolean, will it map correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't been able to test this locally yet, will be checking that this works properly!

# First boot file does not exist
# Record startup begin for monitoring
source "${MONITORING_UTILS_FILE}"
record_devcontainer_start "${CLOUD_PLATFORM}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it take in CLOUD_PLATFORM?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants